﻿using System;

namespace Caramel.Cqrs
{
	public abstract class QueryProcessor<TQuery, TQueryResult> : IQueryProcessor<TQuery, TQueryResult>
		where TQuery : class, IQuery
		where TQueryResult : class, IQueryResult
	{
		public abstract TQueryResult Process(TQuery query);

		IQueryResult IQueryProcessor.Process(IQuery query)
		{
			return this.Process(query as TQuery) as TQueryResult;
		}
	}
}
